include Makefile.cpu
# Gnu compiler on a 64-bit machine
ifeq ($(CPU),default)
      FOPT    = -fdefault-integer-8 -ffree-line-length-none -O2 -fPIC -Itt-fort/
      FC   = gfortran
      LDR   = gfortran -fPIC
      CC    = gcc
      COPT = -O2 -fPIC
      LIB   = 
      MATLAB = matlab
      MCFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer -pthread
      MLLIB2 = 
endif
# Intel compiler on a 64-bit machine
ifeq ($(CPU),default-intel)
      FOPT    = -i8 -O2 -fPIC -vec-report=0 -Itt-fort/
      FC   = ifort
      LDR   = ifort -fPIC -static-intel
      CC    = icc
      COPT = -O2 -fPIC
      LIB   = -mkl
      MATLAB = matlab
      MCFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer -pthread
      MLLIB2 = ${MKLROOT}/../compiler/lib/intel64/libifcoremt_pic.a 
endif

# Gnu compiler on a 32-bit machine
ifeq ($(CPU),default-x32)
      FOPT    = -ffree-line-length-none -O2 -fPIC -Itt-fort/
      FC   = gfortran
      LDR   = gfortran -fPIC
      CC    = gcc
      COPT = -O2 -fPIC
      LIB   = 
      MATLAB = matlab
      MCFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer -pthread
      MLLIB2 = 
endif
# Intel compiler on a 32-bit machine
ifeq ($(CPU),default-intel-x32)
      FOPT    = -O2 -fPIC -vec-report=0 -Itt-fort/
      FC   = ifort
      LDR   = ifort -fPIC -static-intel
      CC    = icc
      COPT = -O2 -fPIC
      LIB   = -mkl
      MATLAB = matlab
      MCFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer -pthread
      MLLIB2 = ${MKLROOT}/../compiler/lib/intel64/libifcoremt_pic.a 
endif


####### Below are some presets for Moscow and Leipzig machines. Poke around them on your own risk

ifeq ($(CPU),mac-gfort)
      FOPT    = -m64 -std=f2008 -ffree-line-length-none -fdefault-integer-8 #-xSSE4.2
      FC = gfortran
	  LDR     = clang
      CC      = clang # ${FOPT}
      MATLAB = matlab
	  #LIB     = -L/usr/local/lib  -lgoto2 -lfftw3
      #LIB     = -L/usr/local/lib -lpthread -llapack_goto -lblas_goto -ldfftpack -lfftw3
      #LIB = -L/Library/Frameworks/EPD64.framework/Versions/7.2/lib -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm
      #LIB =  -L/usr/local/lib libgoto2.a
      #LIB = -L/usr/local/lib/ -lmkl  -llapack  -lgomp
      #LDFLAG = '-undefined dynamic_lookup ${LIB}'
      LIB = -llapack -lblas -lgomp
      #LIB = /Applications/MATLAB_R2011a.app/bin/maci64/mkl.dylib  /Applications/MATLAB_R2011a.app/bin/maci64/mllapack.dylib
      #LIB = -L/Applications/MATLAB_R2011a.app/bin/maci64/ -lmwlapack -lmwblas
      #LIB =  -L/usr/local/lib/    -lmkl_intel_ilp64
      #LIB     = -framework veclib
      #/usr/local/lib  -llapack -lblas -lfftw3
endif
ifeq ($(CPU),fujik-sun)
      FORT   = sunf95 -O3 -xopenmp -xautopar ${FOPT}
      FORTNO = sunf95 -O0 ${FOPT}
      LDR   = sunf95 ${FOPT}
      CC    = suncc ${FOPT}
      LIB   = -O3 -xlic_lib=sunperf -xopenmp -xautopar
endif
ifeq ($(CPU),fujik-ifort)
      FORT   = ifort -O2 -openmp-report=1 ${FOPT}
      FORTNO = ifort -O0 ${FOPT}
      LDR   = ifort ${FOPT}
      CC    = icc ${FOPT}
      LIB   = -mkl
endif
ifeq ($(CPU),spring-ifort)
      FOPT    = -i8
      FORT   = ifort -O2 -fPIC -vec-report=0 ${FOPT}
      FORTNO = ifort -O0 ${FOPT}
      LDR   = ifort ${FOPT}
      CC    = icc -O2 -fPIC
      LIB   = -mkl
      #LIB   = -L /opt/local/acml/ifort64_mp/lib -lacml_mp -lfftw3
endif
ifeq ($(CPU),dc-laptop-intel)
      FOPT    = -i8 -O2 -fPIC -vec-report=0 -Itt-fort/
      FC   = ifort
      LDR   = ifort -static-intel
      CC    = icc
      COPT = -O2 -fPIC
      LIB   = -mkl
      MATLAB = matlab
      MCFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer -pthread
      MLLIB2 = /opt/intel/composerxe-2013.2.144/compiler/lib/intel64/libifcoremt_pic.a 
endif
ifeq ($(CPU),mpg-intel)
      FOPT    = -i8 -O2 -fPIC -vec-report=0 -Itt-fort/
      FC   = ifort
      LDR   = ifort -static-intel
      CC    = icc
      COPT = -O2 -fPIC
      LIB   = -mkl
      MATLAB = /opt/local/matlab2011b/bin/matlab
      MCFLAGS = -fexceptions -fPIC -fno-omit-frame-pointer -pthread
      MLLIB2 = /opt/local/intel/composer_xe_2013.4.183/compiler/lib/intel64/libifcoremt_pic.a
endif
ifeq ($(CPU),mpg-gfort)
      FORT     = gfortran -O2 -ffree-line-length-none ${FOPT}
      FORTNO   = gfortran -O0 -ffree-line-length-none ${FOPT}
      LDR     = gfortran ${FOPT}
      CC      = gcc # ${FOPT}
      #LIB   = -L /opt/local/acml/gfortran64_mp/lib -lacml_mp -lfftw3
      #LIB   = -L /opt/local/intel/fce/11.0.070/mkl/lib/em64t/ -lmkl -lfftw3
      LIB = -lblas -llapack -lfftw3
endif
ifeq ($(CPU),mpg-mpi)
      FORT     = mpif90 -O2 -ffree-line-length-none ${FOPT}
      FORTNO   = mpif90 -O0 -ffree-line-length-none ${FOPT}
      LDR     = mpif90 ${FOPT}
      CC      = mpicc # ${FOPT}
      LIB = -lblas -llapack -lfftw3
endif
ifeq ($(CPU),ost)
      FORT     = mpif77 -fast -m64 -xvector=simd
      FORTNO   = mpif77 -O0 -m64 -xvector=simd
      LDR     = mpif77 -fast -m64 -xvector=simd
      CC      = mpicc -fast -m64 -xvector=simd  -xautopar
      LIB     = -xlic_lib=sunperf
endif

